package top.yekongle.threadpool.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import top.yekongle.threadpool.common.AsyncManager;

import java.util.TimerTask;

/**
 * @author Hank Lau
 * @date 2022/8/24
 */
@Slf4j
@Service
public class AsyncTask {

	@Async
	public void testLog2() {
		log.info("hello world11111");
	}


	public void testLog3() {
		AsyncManager.me().execute(new Runnable() {
			@Override
			public void run() {
				log.info("hello world3333");
			}
		});

		AsyncManager.me().execute(new TimerTask() {
			@Override
			public void run() {
				log.info("hello world44444");
			}
		});
	}

}
